home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_5653_000028.msg < prev    next >
Encoding:
Text File  |  1994-11-27  |  1.5 KB  |  42 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!uni-heidelberg!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb!feck
  3. From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
  4. Subject: Re: How to detach from cli.
  5. Message-ID: <1994Feb8.193709@informatik.uni-kl.de>
  6. Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
  7. Nntp-Posting-Host: uklirb.informatik.uni-kl.de
  8. Organization: University of Kaiserslautern, Germany
  9. References:  <1994Feb8.110410.22728@dmu.ac.uk>
  10. Date: Tue, 8 Feb 1994 18:37:09 GMT
  11. Lines: 29
  12.  
  13. In article <1994Feb8.110410.22728@dmu.ac.uk>, se1pt@dmu.ac.uk (Paul Toyne) writes:
  14. > Cli detaching from assembler is very easy, and goes like follows :
  15. >     Section    Start,CODE
  16. > _Start:
  17. >     ; Check for WB startup, if so  Jmp _Program
  18. >     ; Open dos library
  19. >     Lea    _Start(pc),a0
  20. >     Move.l    (a0),d3        ; Pointer to segment list.
  21. >     Clr.l    (a0)        ; Make dos think that this program
  22. >                 ;  only contains one hunk, so that it
  23. >                 ;  doesn't de-allocate the memory from
  24. >                 ;  our program.
  25.  
  26. This is VERY bad programming practise.  You should not touch the
  27. segment list.
  28.  
  29. The correct way to do detaching (whatever reason you might have
  30. to not use "run") is to NULL out the cli_Module pointer, and
  31. start a new process with this segment and with a different
  32. entry point (use CreateNewProc).
  33.  
  34. An example can be found in the source code to `term'.
  35.  
  36. 3k// Christoph Feck, TowerSystems
  37. \X/ Amiga - Intuition inside.
  38.